<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="org.apache.struts.taglib.html.Constants" %>
<%@ page import="org.apache.struts.Globals" %>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tld/core.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/fn.tld" prefix="fn" %>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
<jsp:include page="../pub_head.jsp">
<jsp:param value="3" name="type"/>
</jsp:include>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META content="text/html; charset=UTF-8" http-equiv="Content-Type">
<META http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<title>核对订单–国内机票预订查询服务</title>
<meta name='keywords' content='机票预订|特价机票|特价机票预订|打折机票预订|国内机票预订|飞机票预订|航班查询|订机票'/>
<meta name='description' content='网站机票预订频道提供国内机票预订，特价机票预订，航班查询等服务，是您机票查询和飞机票预订的最佳渠道。'/>
<link href="css/orderforms.css" type="text/css" rel="stylesheet" media="all" />
<script type="text/javascript"> 
var SERVER_DATE = new Date();
var cur_payTypeId = '';
var cur_costCouponFee = '0';
var cur_totalFee = '${adultFee}';

 
var isMemberFlag = '';			//会员ID
var tmp_psg_num = '1';
var bind_cellphone = '';
var others_cellphone = '';
var cur_type = 'volumeMark';
var use_coupon_card = '';
var use_big_coupon_card = '';
var has_coupon_cards_4_member = '';
 
var hasCreditCardsHisList = false;		//是否有信用卡客史数据
 
var inputCardType_value = '';
 
   function _getCurrentInputCardType(){
   		var cur_input_type_value = "";
   		$(".inputCardType").each(function(){
   			if($(this).attr("checked")){
   				cur_input_type_value = $(this).val();
   			}
   		});
   		return cur_input_type_value;
   }
 
function errMsg(errmsg){
 
	msg_frame = "<div class=\"errorLeftPrompt\">"
                  +"<div class=\"pmt\">"
                    +"<p>"+errmsg+"</p>"
                    +"<div class=\"inArr\"></div>"
                  +"</div>"
                +"</div>";
				
	return msg_frame;
	
} 		
function check4Code(obj){   
	reg=/^\d{3}$/;   
	if(reg.test(obj)){        
		return true;   
	}else{   
		return false;   
	}   
} 
//验证姓名。
function checkName(value){
	var name = IsEmpty(value);
	if(name==false){
		return false;
	}else{
		if(isOtherName(name)){
			if(CheckAllCnStr(name)){
				return true;
			}else{
				if(CheckEnStr(name)){
					return true;
				}
				else{
					return false;
				}
			}
		}else{
			return false;
		}		
	}
}
/*姓名是否含有特殊符号 */
function isOtherName (strname) 
{
	var GuestName = IsEmpty(strname);
	if (GuestName == false) return false;
	var ErrStr;
	var ErrChar;
	var ArryErrStr;	
	ErrChar="!@#$%^&*()_+|-=\\~`;'[]{}\"':,;.<>?～！@#￥％^&×（）……＋|－＝、〔〕｛｝：“；‘《》？，。、0123456789";
	ErrStr="虚拟,傻冒,先生,小姐,代订,你好,哈哈,服务,孙子,龟儿子";
	
	ArryErrStr = ErrStr.split(",");
	
	for(var k=0;k<GuestName.length;k++){ //是否含有非法字符
		if(ErrChar.indexOf(GuestName.charAt(k))>-1) return false;
	}
	
	if ( ErrStr!=null && ErrStr!="" ){ //是否含有非法字符串
		for (k=0; k<ArryErrStr.length; k++){
			if (GuestName.indexOf(ArryErrStr[k])>-1) return false;
		}
	}
	return true;
}	
/*验证是否全部包含中文字符*/
function CheckAllCnStr(name)
{
    var str = IsEmpty(name);
    if (str == false) return false;
	var filter = /[^\u4e00-\u9fa5]/;
    if (!filter.test(str)) return true;
    return false;
}
 
 
 
function CheckEnStr(name)
{
		if (/^[a-zA-Z\/]+$/.test(name)) {
			var name_ofindex_num = name.indexOf('/');
			var name_oflast_num = name.lastIndexOf('/');
			if (name_ofindex_num <= 0 || name_ofindex_num != name_oflast_num || name_ofindex_num == (name.length - 1)) {
				return false;
			}
		} 
		return true;
}
</script>
<!-- <script type="text/javascript" src="script/ticket/loadLight.js"></script>
<script language="javascript" type="text/javascript" src="script/ticket/card.js"></script>
<script language="javascript" type="text/javascript" src="script/ticket/idnumber.js"></script>
<script language="javascript" type="text/javascript" src="script/ticket/verify.js"></script>
<script type="text/javascript" src="script/jquery.cluetip.js"></script>
<script type="text/javascript" src="script/jquery.layer.js"></script>
<script type="text/javascript" src="script/jquery.orders.js"></script>
 -->
 <script type="text/javascript" src="/min/b=script&amp;f=ticket/loadLight.js,ticket/card.js,ticket/idnumber.js,ticket/verify.js"></script>
 <script type="text/javascript" src="/min/b=script&amp;f=jquery.cluetip.js,jquery.layer.js,jquery.orders.js"></script>
</head>
<body>
<!--Header Begin-->
	    
<!--Header include start-->

<!-- top 专题小头部 end -->
<!--Header include end-->
<!--Header End-->
<form action="" method="post">
<input type="hidden" name="<%=Constants.TOKEN_KEY%>"    value="<%=session.getAttribute(Globals.TRANSACTION_TOKEN_KEY)%>"/> 
<div class="wrapper clearfix">
  <div class="stepout fillingt">
    <h1>核对用户信息<em>建议您认真核对订单信息，以免影响登机。</em></h1>
    <ul>
      <li class="current">选择</li>
      <li class="current">预订</li>
      <li class="current">核对</li>
      <li>完成</li>
    </ul>
  </div>
    
 
  <!--Left Sidebar Begin-->
  <div class="mainorder left">
    <div class="gotocit gotocitorder">
      <div class="t"><span>◀<a href="javascript:update();">返回上页修改订单信息</a></span>
        <h2>您预订航班信息</h2>
      </div>
      <table>
	    <logic:iterate id="order" name="chooseOrders" indexId="index">
		  <tr class="borderb">
		          <td>
			          <strong>
			           <c:if test="${query.voyageType==2 && index==0}">
			        	去程
			        	</c:if>
			        	<c:if test="${query.voyageType==2 && index==1}">
			        	返程
			        	</c:if>
			        	<c:if test="${fn:length(chooseOrders)==1}">
			        	单程
			        	</c:if>
			          </strong>	
			          		         </td>
          <td><img src="flight/airpic/${order.aircom}.gif" width="16" height="16" /> ${order.aircomName}<br />
            ${order.flightNo}</td>
          <td><p>${order.scityName}起飞：<bean:write name="order" property="depTime" format="yyyy-MM-dd HH:mm"/> &nbsp;</p>
            <p>到达${order.ecityName}：<bean:write name="order" property="arrTime" format="yyyy-MM-dd HH:mm"/></p></td>
          <td>
          	<p>成人：&yen;${order.cabinInfo.fare+order.tax+order.yq}（含税）</p>
          </td>
          <td>
          	<p>
          	<c:if test="${order.cabinInfo.level=='B'}">${order.cabinInfo.discount}折经济舱</c:if><c:if test="${order.cabinInfo.level=='Y'}">全价舱</c:if><c:if test="${order.cabinInfo.level=='F'}">头等舱</c:if>/${order.cabinInfo.level}</p>
          </td>
        </tr>
      </logic:iterate>
  </table>   
    </div>
<div class="mBox none" id="creditCardsHisDiv">
  <div class="mT"><span>请直接输入或用&uarr;&darr;选择</span><a href="javascript:void(0)" class="colseKe" title="关闭">关闭</a></div>
  <div class="mglist">
    <ul>
    </ul>
  </div>
</div>
    <!--乘客信息 Begin-->
    <div class="opbhd ck">
      <div class="t">
        <h2>乘客信息</h2>
        <span>1</span></div>
      <div class="opbc">
        <div class="opbright manbar">
            <logic:iterate id="passenger" name="pepoleList">
	            <ul>
	              <li class="txt">乘客类型：</li>
	              <li>
	              <c:if test="${passenger.pageType==1}">成人</c:if>
	              <c:if test="${passenger.pageType==2}">儿童 2岁-12岁</c:if>
	              <c:if test="${passenger.pageType==3}">婴儿 14天-24个月</c:if>
	              &nbsp;&nbsp;&nbsp;&nbsp;
	              姓名：
	              ${passenger.username}&nbsp;&nbsp;&nbsp;&nbsp;
	              
		             <c:if test="${passenger.cardType==1}">身份证</c:if>
	              <c:if test="${passenger.cardType==2}">护照</c:if>
	              <c:if test="${passenger.cardType==3}">军官证</c:if>：${passenger.card}&nbsp;&nbsp;&nbsp;&nbsp;
				  </li>
	            </ul>
            </logic:iterate>
        </div>
      </div>
    </div>
	·   <!--乘客信息 End-->
    <!--联系人信息 Begin-->
    <div class="opbhd lx">
      <div class="t">
        <h2>联系人信息</h2>
        <span>2</span></div>
      <div class="opbc">
        <div class="opbright manbar">
          <ul>
            <li class="txt">姓名：</li>
            <li>${linkName }</li>
          </ul>
          <ul>
            <li class="txt">手机号：</li>
            <li>${callphone }</li>
          </ul>
          
          <%--<ul>
            <li class="txt">电子邮件：</li>
            <li>superhk86@gmail.com</li>
          </ul>
        --%></div>
      </div>
    </div>
    <input name="linkName" value="${linkName }" type="hidden" />
    <input name="callphone" value="${callphone }" type="hidden" />
    <!--联系人信息 End-->
    <!--支付方式 Begin-->
    <!--支付方式 End-->
    <!--报销凭证 Begin-->
   <!--报销凭证 End-->
    
    <div class="subdiv"><a href="javascript:toSubmit();" id="subbtn" class="submit">下一步，核对订单</a><a href="javascript:update();" class="backssl" style="display: none">返回修改订单信息</a></div>
  </div>
</form>
  <!--Left Sidebar End-->
  <!--Right Sidebar Begin-->
  <!--Right Sidebar Begin-->
  <div class="sideRight right" id="adside">
    <div class="fillingin">
      <h2>费用总计</h2>
      <ul>
        <li>成人：<span id="adult_fee">&yen;${adultFee}(X${fn:length(pepoleList)}人)</span></li>
        
        
			<li id="child_fee_li" style="display:none">儿童：<span id="child_fee">&yen;1200(X0人)</span></li>
        
			<li id="baby_fee_li" style="display:none">婴儿：<span id="baby_fee">&yen;220(X0人)</span></li>
        
      </ul>
      <div class="totalcost">订单总金额：<span id="total_fee">&yen;${adultFee*fn:length(pepoleList)}</span></div>
	      <ul style="display:none" class="totalamount">
	      	<li style="color: rgb(44, 126, 175);"><strong>订单总金额</strong>等于以下几项相加</li>
	      	<li id="pay_fee_li">支付金额：<span class="pay_fee">&yen;${adultFee*fn:length(pepoleList)}</span></li>
	      	<li id="pay_fee_li">交易手续费：<span class="pay_fee">&yen;${order.cabinInfo.rate.agentFee}</span></li>
	      </ul>
	  
    </div>
    <div class="tel12580"><img src="images/tel_small.jpg"/></div>
  </div>
  <!--Right Sidebar End-->
  </div>
<div id="loading" style="display:none; border: solid 10px #247FB6; height: 80px;background-color: #FFFFFF;">
	<ul>
    	<li id="showcontent" class="tbig" style="height: 80px; line-height: 80px; vertical-align: middle;font-weight: bolder; color: black"><p>正在为您提交订单，请稍候...</p></li>
    </ul> 
</div>
<!--Footer Begin-->
 
<!--Footer Start-->
<%@include file="../footer.jsp" %>
 
<!--Footer End-->
 
<!--Footer End-->
</body>
</html>
<script type="text/javascript"> 
var ccFlag=false;  //信用卡验证标识
var reSubmit = false;
 function toSubmit(){
		reSubmit_fun();
	 		var url="flight/flightOrder.do?op=createOrder";
			document.forms[0].action = url;
			document.forms[0].submit();
 }
 
function reSubmit_fun(){
		$('#subbtn').attr('disabled','disabled');
		ShowDivWin(450,130,'loading');
}
//调节函数
function ShowDivWin(DW,DH,Did)
{
	var diag = new dialogLayer();
	diag.Width = DW;
	diag.Height =DH;
	diag.InvokeElementId=Did
	diag.show();
}
 
 function update(){
 	//document.forms[0].action = '#';
	//document.forms[0].submit();
 }
 
function count_cards(){
   var i=0;
   $(".card_index").each(function(){
		i++;
   });
   return i;
}
function reIndex(){
   var i=1;
   $(".card_index").each(function(){
		$(this).html(i++);
   });
   return i;
}

function bind4Verify(){
	$(".verification").unbind("click");
	$(".verification").bind("click", function(){
		init4Codes();    //验证并显示结果列表	
	});
}
 
function init4VolumeWith(){
	var contents = "";
	contents += "<ul><li>手机号：<input type=\"text\" id=\"withCellphone\" value=\"\" class=\"onInput\" /></li></ul>"
			 +"<div class=\"cxb volumebtn\"><input type=\"button\" name=\"rr\" class=\"searchform getVerifyCode\" value=\"获得手机验证码\"></div>";
	$(".volumeWith").html(contents);
	bind4GetVerifyCode();  //绑定获取验证码按钮
}
function bindShowmsg4selects4Others(){
	$(".selectsss4Others").unbind("focus");
	$(".selectsss4Others").bind("focus", function(){ 
		//$(this).after(showMsg()); 
	 });//姓名校验
	$(".selectsss4Others").unbind("blur");
	$(".selectsss4Others").bind("blur", function(){ 
		$(this).next().remove();
	});
	$(".selectsss4Others").unbind("change");
	$(".selectsss4Others").bind("change", function(){
		var id = $(this).attr("id");
		var value = $(this).val();
		if(value!="0"){
			$(this).after(showMsg());
		}
		changeOthers(id,"selectsss4Others");
		calcFee();
	});
}
function bind4verifyTheCode(cellphone){
	$(".verify4Code").unbind("click");
	$(".verify4Code").bind("click",function(){
 
		var code = $("#verifyCode").val();
		if(code!=""){
 
		}
	});
}
//绑定手机号校验
function bind4Cellphone(){
	$("#withCellphone").focus(function(){
	    $(this).next().remove();
	});
	$("#withCellphone").blur(function(){
	    if (!IsMobileNoAlert($(this).val())&& $(this).val()!='')
		    $(this).after(errMsg("您输入的手机号码有误，请正确输入中国移动的手机号码"));
		else {
		    $(this).next().remove();
		}
	});
}
</script>


